package br.com.trophy.trophies;

import br.com.trophy.R;
import br.com.trophy.parsing.Game;
import br.com.trophy.parsing.Trophy;
import android.app.Activity;
import android.os.Bundle;
import android.widget.EditText;

public class TrophyView extends Activity
{
	// ----------------------------------------------------------------------
	// Atributos de classe
	// ----------------------------------------------------------------------
	
	// Objetos da tela
	private EditText editTextName;
	private EditText editTextType;
	private EditText editTextDesc;

	// Manipulação entre telas
	private String name;
	private String type;
	private String desc;
	@SuppressWarnings ( "unused")
	private Game game;
	private Trophy trofeu;

	// ----------------------------------------------------------------------
	// Metodos Sobrecarregados
	// ----------------------------------------------------------------------
	@Override
	public void onCreate( Bundle savedInstanceState )
	{
		super.onCreate( savedInstanceState );
		setContentView( R.layout.layout_trophy );

		createViews();
		getExtras();
		setViews();
	}
	// ----------------------------------------------------------------------
	// Metodos Privados
	// ----------------------------------------------------------------------
	private void createViews()
	{
		//TODO: aumentar o numero de informações
		editTextName 	= (EditText) findViewById( R.id.etName );
		editTextType 	= (EditText) findViewById( R.id.etType );
		editTextDesc 	= (EditText) findViewById( R.id.etDesc );
	}
	// ----------------------------------------------------------------------
	private void getExtras()
	{
		Bundle extrasGame = getIntent().getExtras();
		game 		= (Game)extrasGame.getParcelable( "game" );
		Bundle extrasTrophies = getIntent().getExtras();
		trofeu 		= (Trophy)extrasTrophies.getParcelable( "trophies" );
		
		name 	= trofeu.getName();
		type 	= trofeu.getType();
		desc 	= trofeu.getDesc();
	}
	// ----------------------------------------------------------------------
	private void setViews()
	{
		//TODO: vamos elaborar um visual melhor
		editTextName.setText( name );
		editTextType.setText( type );
		editTextDesc.setText( desc );
	}
	// ----------------------------------------------------------------------
}
